<%@ page contentType="text/html; charset=utf-8" language="java" import="java.util.*" pageEncoding="utf-8" errorPage="" %>
<%@ page session="false" %>

<%
	HttpSession se = request.getSession(false);
	String name = null;
	String role = null;
	if (se == null) {
		response.sendRedirect("/Microblog/pages/timeout.html");
		return;
	}
	name = (String)se.getAttribute("username");
	if (name == null) {
		response.sendRedirect("/Microblog/pages/timeout.html");
		return;
	}
	role = (String)se.getAttribute("userrole");
	if (role == null) {
		response.sendRedirect("/Microblog/pages/timeout.html");
		return;
	}
	if (!role.equals("1")) {
		request.setAttribute("tip", "您没有管理权限...");
		request.setAttribute("target", "#");
		request.getRequestDispatcher("/pages/error.jsp").forward(request,
					response);
		return;
	}
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/background.dwt.jsp" codeOutsideHTMLIsLocked="false" -->
<head>
<!-- InstanceBeginEditable name="doctitle" -->
<title>管理中心</title>
<!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="head" -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<meta http-equiv="Keywords" content="Microblog,Vioce,blog" />
<meta http-equiv="Description" content="Voice Microblog" />
<link href="/Microblog/styles/frame.css" rel="stylesheet" type="text/css" />
<!-- InstanceEndEditable -->
<link href="/Microblog/styles/template.css" rel="stylesheet" type="text/css" />
<link href="/Microblog/styles/global.css" rel="stylesheet" type="text/css" />
</head>

<%
	HttpSession session = request.getSession(false);
	String username = null;
	String userrole = null;
	String targetuser = null;
	if (session != null) {
		username = (String)session.getAttribute("username");
		userrole = (String)session.getAttribute("userrole");
		targetuser = username;
	}
%>

<body>
<div class="top">
  <div id="top_main"> 
    <%
    	if (username != null)
    	{
    %>
      <ul>
      <li><a href="/Microblog/pages/user_frame.jsp"><%= username %></a></li>
      <li><a href="/Microblog/VoiceblogPlazaServlet">广场</a></li>
      <li><a href="#">通知</a></li>
      <li><a href="#">帐号设置</a></li>
      <li>|<a href="/Microblog/LogOutServlet">退出</a></li>
      </ul>
    <%
    	}
    %> 
  </div>
</div>
<div class="main">
  <div id="head">
  <img src="/Microblog/images/logo.png" width="180" height="53" alt="logo" />
  	<div id="head_nav">
	<ul>
    	<li><a href="/Microblog/VoiceblogHomeServlet">我的首页</a></li>
    	<%
		if (username != null)
    	{
		%>
        <li><a href="/Microblog/VoiceblogMineServlet?targetuser=<%= username%>">我的微博</a></li>
        <%
		} else {
		%>
		<li><a href="#">我的微博</a></li>
		<%
		}
		%>
        <li><a href="/Microblog/pages/user_frame.jsp">会员中心</a></li>
        <li><a href="/Microblog/pages/admin_frame.jsp">管理中心</a></li>
  	</ul>
    </div>
  </div>
</div>
<!-- InstanceBeginEditable name="EditRegion_mian" -->
<div class="body">
	<div id="admin_topic"></div>
	<div id="left">
    <ul>
    	<li class="announcement"><a href="/Microblog/pages/unfinished.html" target="admin_contents">公告管理</a></li>
        <li class="view"><a href="/Microblog/pages/unfinished.html" target="admin_contents">查看投诉</a></li>
        <li class="management"><a href="/Microblog/ForbiddenInfoServlet" target="admin_contents">管理用户</a></li>
        <li class="statistics"><a href="/Microblog/pages/unfinished.html" target="admin_contents">统计信息</a></li>
    </ul>
	</div>
    <div id="right">
    	<iframe id="admin_contents" name="admin_contents" src="/Microblog/ForbiddenInfoServlet" scrolling="no" width="648" frameborder="0" onload="this.height=240"></iframe>
        <script type="text/javascript">
		function reinitIframe(){
		var iframe = document.getElementById("admin_contents");
		try{
			var bHeight = iframe.contentWindow.document.body.scrollHeight;
			var dHeight = iframe.contentWindow.document.documentElement.scrollHeight;
			var height = Math.max(bHeight, dHeight);
			iframe.height =  height;
		}catch (ex){}
		}
		window.setInterval("reinitIframe()", 200);
		</script>
    </div>
    <div id="bottom"></div>
</div>
<!-- InstanceEndEditable -->
<div class="bottom">
  <p>Copyright © 2010 - 2011 CLUB325.  All Rights Reserved<br/>
  CLUB325  版权所有</p>
</div>
</body>
<!-- InstanceEnd --></html>
